package org.lq.ht.view.room;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.ComponentEvent;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import org.lq.ht.util.WindowsSplit;

import javax.swing.JSplitPane;

public class MainRoom extends JFrame {

	JSplitPane splitPane;
	private JPanel contentPane;
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					MainRoom frame = new MainRoom();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public MainRoom() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 800, 600);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(new BorderLayout(0, 0));
		 splitPane= new JSplitPane();
		contentPane.add(splitPane, BorderLayout.CENTER);
		
		JPanel panel = (JPanel) new AddCustomer().getContentPane();
		splitPane.setLeftComponent(panel);
		
		JPanel panel_1 = (JPanel) new TwoRoomTable().getContentPane();
		splitPane.setRightComponent(panel_1);
		splitPane.addComponentListener(new WindowsSplit() {
			@Override
			public void componentResized(ComponentEvent e) {
				splitPane.setDividerLocation(0.26);
			}
		});
	}

}
